home *** CD-ROM | disk | FTP | other *** search
/ Amiga CD-Sensation: Golden Games / Amiga CD-Sensation - Ausgabe 2 - Golden Games (1996)(GTI - Schatztruhe)(DE)[!].iso / Archive / Funny Stuff / AlertPicture.lha / jiff.h < prev    next >
C/C++ Source or Header  |  1992-09-02  |  3KB  |  112 lines

  1. /* --------------------------------------------------------------------- */
  2. #define LO_RES
  3.  
  4. #ifdef HI_RES
  5. #define XMAX 640
  6. #define YMAX 200
  7. #define PLANES 4
  8. #define MAXCOL (1<<PLANES)
  9. #define XASPECT 5
  10. #define YASPECT 11
  11. #endif
  12.  
  13. #ifdef LO_RES
  14. #define XMAX 320
  15. #define YMAX 200
  16. #define PLANES 5
  17. #define MAXCOL (1<<PLANES)
  18. #define XASPECT 10
  19. #define YASPECT 11
  20. #endif
  21.  
  22. /* --------------------------------------------------------------------- */
  23. /* EA handy make a long from 4 chars macros redone to work with Aztec*/
  24. #define MAKE_ID(a, b, c, d)\
  25.     ( ((long)(a)<<24) + ((long)(b)<<16) + ((long)(c)<<8) + (long)(d) )
  26.  
  27. /* these are the IFF types I deal with */
  28. #define FORM MAKE_ID('F', 'O', 'R', 'M')
  29. #define ILBM MAKE_ID('I', 'L', 'B', 'M')
  30. #define BMHD MAKE_ID('B', 'M', 'H', 'D')
  31. #define CMAP MAKE_ID('C', 'M', 'A', 'P')
  32. #define BODY MAKE_ID('B', 'O', 'D', 'Y')
  33.  
  34. /* and these are the IFF types I ignore but don't squawk about */
  35. #define GRAB MAKE_ID('G', 'R', 'A', 'B')
  36. #define DEST MAKE_ID('D', 'E', 'S', 'T')
  37. #define SPRT MAKE_ID('S', 'P', 'R', 'T')
  38. #define CAMG MAKE_ID('C', 'A', 'M', 'G')
  39. #define CRNG MAKE_ID('C', 'R', 'N', 'G')
  40. #define CCRT MAKE_ID('C', 'C', 'R', 'T')
  41.  
  42. /* --------------------------------------------------------------------- */
  43. /* Some macros for raster memory allocation ... redefine if you're
  44.    sensible and manage memory locally */
  45.  
  46. /* ralloc - raster alloc*/
  47. #define ralloc(amount)  (PLANEPTR)AllocMem((long)(amount), MEMF_CHIP)
  48. /* rfree - raster free*/
  49. #define rfree(pt, amount)    FreeMem( (pt), (long)(amount) )
  50.  
  51. /*line_bytes = the number of words * 2 (for bytes) a raster line takes up */
  52. #define line_bytes(width)    (((width+15)>>4)<<1)
  53.  
  54. /* psize - plane size in bytes (an even number) of a raster given
  55.    width and height */
  56. #define psize(width, height) ( line_bytes(width)*height)
  57.  
  58. /* the place to throw excess bits */
  59. #define bit_bucket(file, length) fseek(file, (long)(length), 1)
  60.  
  61.  
  62. /* --------------------------------------------------------------------- */
  63. union bytes4
  64.     {
  65.     char b4_name[4];
  66.     long b4_type;
  67.     };
  68.  
  69. struct iff_chunk
  70.     {
  71.     union bytes4 iff_type;
  72.     long iff_length;
  73.     };
  74.  
  75. struct form_chunk
  76.     {
  77.     union bytes4 fc_type; /* == FORM */
  78.     long fc_length;
  79.     union bytes4 fc_subtype;
  80.     };
  81.  
  82. struct BitMapHeader
  83.     {
  84.     UWORD w, h;
  85.     UWORD x, y;
  86.     UBYTE nPlanes;
  87.     UBYTE masking;
  88.     UBYTE compression;
  89.     UBYTE pad1;
  90.     UWORD transparentColor;
  91.     UBYTE xAspect, yAspect;
  92.     WORD pageWidth, pageHeight;
  93.     };
  94.  
  95. /*ILBM_info is the structure read_iff returns, and is hopefully all
  96.   you need to deal with out of the iff reader routines below*/
  97. struct ILBM_info
  98.     {
  99.     struct BitMapHeader header;
  100.     UBYTE cmap[MAXCOL*3];    /*say hey aztec don't like odd length structures*/
  101.     struct BitMap bitmap;
  102.     };
  103.  
  104.  
  105. /* --------------------------------------------------------------------- */
  106. struct ILBM_info *read_iff(char *, struct ILBM_info *, short);
  107. int write_iff(char *, unsigned char *, register struct BitMap *, short, short, short, short);
  108. void free_planes(register struct BitMap *);
  109.  
  110. /* Anyone know where some useful minterms are defined? */
  111. #define COPY_MINTERM        0xc0
  112.